package com.taobao.yugong.translator;

import com.taobao.yugong.common.db.meta.ColumnMeta;
import com.taobao.yugong.common.db.meta.ColumnValue;
import com.taobao.yugong.common.model.record.Record;
import org.apache.commons.lang.time.DateUtils;

import java.sql.Types;
import java.util.Date;

/**
 * @description: 物品表数据同步
 * @website: http://www.ziroom.com
 * @author: yanglp
 * @email: yanglp@ziroom.com
 * @date: 2020-11-02 15:29
 * @since: 1.0.0
 */
public class BzHouseNewDataTranslator extends AbstractDataTranslator implements DataTranslator {
    @Override
    public String translatorSchema() {
        return "jz_resblock_archives";
    }

    @Override
    public String translatorTable() {
        return "jra_house_new";
    }

    @Override
    public boolean translator(Record record) {

        record.setTableName("jra_house_new");

        ColumnValue ownership_code = record.getColumnByName("OWNERSHIP_CODE");
        record.getColumns().remove(ownership_code);

        ColumnValue buildingNo = record.getColumnByName("BUILDING_NO");
        record.getColumns().remove(buildingNo);

        ColumnValue unit = record.getColumnByName("unit");
        record.getColumns().remove(unit);

        ColumnValue floorTotal = record.getColumnByName("FLOOR_TOTAL");
        record.getColumns().remove(floorTotal);

        ColumnValue floor = record.getColumnByName("FLOOR");
        record.getColumns().remove(floor);

        ColumnValue roomNo = record.getColumnByName("ROOM_NO");
        record.getColumns().remove(roomNo);

        ColumnValue mailboxNo = record.getColumnByName("MAILBOX_NO");
        record.getColumns().remove(mailboxNo);

        ColumnValue propertyAddress = record.getColumnByName("PROPERTY_ADDRESS");
        record.getColumns().remove(propertyAddress);

        ColumnValue isExchange = record.getColumnByName("IS_EXCHANGE");
        record.getColumns().remove(isExchange);

        ColumnValue frameCode = record.getColumnByName("FRAME_CODE");
        record.getColumns().remove(frameCode);

        ColumnValue disposeFrameCode = record.getColumnByName("DISPOSE_FRAME_CODE");
        record.getColumns().remove(disposeFrameCode);

        ColumnValue buildSize = record.getColumnByName("BUILD_SIZE");
        record.getColumns().remove(buildSize);

        ColumnValue buildingType = record.getColumnByName("BUILDING_TYPE");
        record.getColumns().remove(buildingType);

        ColumnValue propertyType = record.getColumnByName("PROPERTY_TYPE");
        record.getColumns().remove(propertyType);

        ColumnValue orientation = record.getColumnByName("ORIENTATION");
        record.getColumns().remove(orientation);

        ColumnValue usageType = record.getColumnByName("USAGE_TYPE");
        record.getColumns().remove(usageType);

        ColumnValue fitmentCode = record.getColumnByName("FITMENT_CODE");
        record.getColumns().remove(fitmentCode);

        ColumnValue scene = record.getColumnByName("SCENE");
        record.getColumns().remove(scene);

        ColumnValue isAnearSubway = record.getColumnByName("IS_ANEAR_SUBWAY");
        record.getColumns().remove(isAnearSubway);

        ColumnValue isSchoolDistrict = record.getColumnByName("IS_SCHOOL_DISTRICT");
        record.getColumns().remove(isSchoolDistrict);

        ColumnValue updatedTime = record.getColumnByName("UPDATED_TIME");
        record.getColumns().remove(updatedTime);

        ColumnValue homelinkCity = record.getColumnByName("HOMELINK_CITY");
        record.getColumns().remove(homelinkCity);

        ColumnValue batch = record.getColumnByName("BATCH");
        record.getColumns().remove(batch);

        ColumnValue rentStatus = record.getColumnByName("RENT_STATUS");
        record.getColumns().remove(rentStatus);

        ColumnValue isStock = record.getColumnByName("IS_STOCK");
        record.getColumns().remove(isStock);

        ColumnValue houseStatus = record.getColumnByName("HOUSE_STATUS");
        record.getColumns().remove(houseStatus);

        ColumnValue buildingFrame = record.getColumnByName("BUILDING_FRAME");
        record.getColumns().remove(buildingFrame);

        ColumnValue bizcircleId = record.getColumnByName("BIZCIRCLE_ID");
        record.getColumns().remove(bizcircleId);

        ColumnValue legacyHouseId = record.getColumnByName("LEGACY_HOUSE_ID");
        record.getColumns().remove(legacyHouseId);

        ColumnValue isSynchTimeBuilding = record.getColumnByName("IS_SYNCH_TIME_BUILDING");
        record.getColumns().remove(isSynchTimeBuilding);

        ColumnValue name = record.getColumnByName("name");
        record.getColumns().remove(name);

        ColumnValue ladderAmount = record.getColumnByName("LADDER_AMOUNT");
        record.getColumns().remove(ladderAmount);

        ColumnValue familyAmount = record.getColumnByName("FAMILY_AMOUNT");
        record.getColumns().remove(familyAmount);

        ColumnValue supplyHeat = record.getColumnByName("SUPPLY_HEAT");
        record.getColumns().remove(supplyHeat);

        ColumnValue feature = record.getColumnByName("FEATURE");
        record.getColumns().remove(feature);

        ColumnValue otherIntro = record.getColumnByName("OTHER_INTRO");
        record.getColumns().remove(otherIntro);

        ColumnValue unitPhoto = record.getColumnByName("UNIT_PHOTO");
        record.getColumns().remove(unitPhoto);

        ColumnValue isScheme = record.getColumnByName("IS_SCHEME");
        record.getColumns().remove(isScheme);

        ColumnValue zrHouseCode = record.getColumnByName("ZR_HOUSE_CODE");
        record.getColumns().remove(zrHouseCode);

        ColumnValue ownerIdBak = record.getColumnByName("OWNER_ID_BAK");
        record.getColumns().remove(ownerIdBak);

        ColumnValue unitPhotoDate = record.getColumnByName("UNIT_PHOTO_DATE");
        record.getColumns().remove(unitPhotoDate);


        ColumnValue auditState = record.getColumnByName("AUDIT_STATE");
        record.getColumns().remove(auditState);

        ColumnValue lastModifyTimeSynchronous = record.getColumnByName("LAST_MODIFY_TIME_SYNCHRONOUS");
        record.getColumns().remove(lastModifyTimeSynchronous);

        ColumnValue arrearageState = record.getColumnByName("ARREARAGE_STATE");
        record.getColumns().remove(arrearageState);

        ColumnValue isWaveWash = record.getColumnByName("IS_WAVE_WASH");
        record.getColumns().remove(isWaveWash);

        ColumnValue preHouseType = record.getColumnByName("PRE_HOUSE_TYPE");
        record.getColumns().remove(preHouseType);

        ColumnValue houseRating = record.getColumnByName("HOUSE_RATING");
        record.getColumns().remove(houseRating);

        ColumnValue territoryCode = record.getColumnByName("TERRITORY_CODE");
        record.getColumns().remove(territoryCode);



        return super.translator(record);
    }
}